package com.rcd.manager.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.rcd.dao.ISubitemDao;
import com.rcd.exception.MyException;
import com.rcd.manager.dao.ISubitemManagerDao;
import com.rcd.util.Page;
import com.rcd.vo.Subitem;
@Component
public class ISubitemManagerimpl implements ISubitemManagerDao {
	private ISubitemDao iSubitemDao;
	@Resource
	public void setISubitemDao(ISubitemDao subitemDao) {
		iSubitemDao = subitemDao;
	}

	public void addSubItem(Subitem subItem) throws MyException {
		// TODO Auto-generated method stub
		try{
			this.iSubitemDao.addSubItem(subItem);
		}catch(MyException e)
		{
			e.printStackTrace();
		}
		
	}

	public void deleteAll(int[] subid) throws MyException {
		// TODO Auto-generated method stub

	}

	public void deleteSubItem(int subid) throws MyException {
		// TODO Auto-generated method stub
		try{
			this.iSubitemDao.deleteSubItem(subid);
		}catch(MyException e)
		{
			e.printStackTrace();
		}
	}

	public List<Subitem> findAll(Page page) throws MyException {
		// TODO Auto-generated method stub
		List<Subitem> list = null;
		try{
			list = this.iSubitemDao.findAll(page);
			
		}catch(MyException e)
		{
			e.printStackTrace();
		}
		return list;
	}

	public Subitem findById(int subid) throws MyException {
		// TODO Auto-generated method stub
		Subitem subitem = null;
		try{
			subitem = this.iSubitemDao.findById(subid);
		}catch(MyException e)
		{
			e.printStackTrace();
		}
		return subitem;
	}

	public void updateSubItem(Subitem subItem) throws MyException {
		// TODO Auto-generated method stub
		try{
			this.iSubitemDao.updateSubItem(subItem);
		}catch(MyException e)
		{
			e.printStackTrace();
		}
	}

}
